investment
<template>
  <div class="app-container">
    <div class="filter-container" id="filter-container-MhBidRecord">
      <el-input
        v-model="listQuery.bidRecordNumber"
        size="small"
        placeholder="编号"
        style="width: 200px; "
        class="filter-item"
        @keyup.enter.native="handleFilter"
        clearable
      />
      <el-input
        v-model="listQuery.mhProjectInfoName"
        size="small"
        placeholder="项目名称"
        style="width: 200px; "
        class="filter-item"
        @keyup.enter.native="handleFilter"
        clearable
      />
      <el-input
        v-model="listQuery.bossDeptName"
        size="small"
        placeholder="主体单位"
        style="width: 200px; "
        class="filter-item"
        @keyup.enter.native="handleFilter"
        clearable
      />
      <el-input
        v-model="listQuery.deptName"
        size="small"
        placeholder="定点供应商名称"
        style="width: 200px; "
        class="filter-item"
        @keyup.enter.native="handleFilter"
        clearable
      />
      <el-input
        v-model="listQuery.categoryName"
        size="small"
        placeholder="类型名称"
        style="width: 200px; "
        class="filter-item"
        @keyup.enter.native="handleFilter"
        clearable
      />
<!--      <select-option
        v-model="listQuery.status"
        size="small"
        placeholder="状态"
        style="width: 200px; "
        class="filter-item"
        :clearable=true
        prop-name="Status"
        :prop-ds-type=1
        prop-url="/citymh/enum/getData4AddBy"
      />-->

      <el-select v-model="listQuery.status" :clearable="true" placeholder="状态" size="small" class="filter-item" style="width: 200px; ">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-date-picker
        v-model="listQuery.createdate"
        type="daterange"
        value-format="yyyy-MM-dd"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="中标日期:开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
        size="small"
        class="filter-item"
        clearable
      />
<!--      <el-cascader placeholder="选择类别" clearable-->
<!--                   class="filter-item"-->
<!--                   size="small"-->
<!--                     v-model="listQuery.mhCategoryId"-->
<!--                     :options="allCategoryData"-->
<!--                     @change="handleCategoryIdChange"-->
<!--                     :props="{children:'mhCategoryList', label:'name', value:'id' ,multiple: false}"-->
<!--                     style="width:400px;"-->
<!--    ></el-cascader>-->
      <el-cascader placeholder="选择类别" :clearable="true" class="filter-item"

                   :options="allCategoryData"
                   @change="handleCategoryIdChange"
                   :props="{children:'mhCategoryList', label:'name', value:'id' ,multiple: true}"
                   style="width:400px;"
      ></el-cascader>
      <el-button :loading="queryLoading" class="filter-item" size="small" type="primary" plain icon="el-icon-search"
                 @click="handleFilter">
        查询
      </el-button>
      <!--<el-button v-if="hasDownloadBtn" :loading="downloadLoading" class="filter-item" size="small" type="primary" plain icon="el-icon-download" @click="handleDownload">
        导出报表
      </el-button>-->
      <!--      <el-button v-if="hasAddBtn" v-show="hasPermission(['mhBidRecord:create'])" class="filter-item" size="small" type="primary" plain icon="el-icon-plus" @click="handleCreate">-->
      <!--        添加-->
      <!--      </el-button>-->
    </div>

    <el-table
      :key="tableKey"
      v-loading="listLoading"
      :data="list"
      border
      fit
      highlight-current-row
      :show-summary="false"
      :summary-method="getSummaries"
      style="width: 100%;"
      :height="tableHeight"
      @sort-change="sortChange"
      @row-click="handleRowClick"
    >
      <!-- 行展开，显示的详细信息 -->
      <el-table-column type="expand">
        <template slot-scope="props">
          <el-form label-position="left" inline class="demo-table-expand" label-width="200px">
            <!--<el-form-item label="ID" >
                  <span>{{ props.row.id }}</span>

            </el-form-item>
            <el-form-item label="项目ID" >
                  <span>{{ props.row.mhProjectInfoId }}</span>

            </el-form-item>
            <el-form-item label="轮次ID" >
                  <span>{{ props.row.mhBidRoundId }}</span>

            </el-form-item>
            <el-form-item label="定点供应商ID" >
                  <span>{{ props.row.tmptAuthDeptId }}</span>

            </el-form-item>-->
            <el-form-item label="编号">
              <span>{{ props.row.bidRecordNumber }}</span>
            </el-form-item>
            <el-form-item label="发起方单位">
              <span>{{ props.row.bossDeptName }}</span>
            </el-form-item>
            <el-form-item label="项目名称">
              <span>{{ props.row.mhProjectInfoName }}</span>
            </el-form-item>
            <el-form-item label="发起方单位联系人">
              <span>{{ props.row.mhProjectInfo|getJsonName('projectMainUnitLinkman') }}</span>
            </el-form-item>
            <el-form-item label="发起方联系人电话 ">
              <span>{{ props.row.mhProjectInfo|getJsonName('telephone') }}</span>
            </el-form-item>
            <el-form-item label="定点供应商名称">
              <span>{{ props.row.deptName }}</span>
            </el-form-item>
            <el-form-item label="供应商法人代表">
              <span>{{ props.row.mhLegalPerson }}</span>
            </el-form-item>
            <el-form-item label="供应商联系人">
              <span>{{ props.row.mhLinkman }}</span>
            </el-form-item>
            <el-form-item label="供应商联系电话">
              <span>{{ props.row.mhPhone }}</span>
            </el-form-item>

            <el-form-item label="项目类型">
              <span>{{ props.row.categoryName }}</span>
            </el-form-item>
            <el-form-item label="项目地址">
              <span>{{ props.row.mhProjectInfo|getJsonName('projectAddr') }}</span>
            </el-form-item>

            <el-form-item label="项目依据">
              <span>{{ props.row.mhProjectInfo|getJsonName('projectBasis') }}</span>
            </el-form-item>
            <el-form-item label="项目建安投资(万)">
              <span>{{ props.row.mhProjectInfo|getJsonName('totalInvestment') }}</span>
            </el-form-item>
            <el-form-item label="市财力(万)">
              <span>{{ props.row.mhProjectInfo|getJsonName('fundSourceCityFinacial') }}</span>
            </el-form-item>
            <el-form-item label="区财政(万)">
              <span>{{ props.row.mhProjectInfo|getJsonName('fundSourceDistrictFinance') }}</span>
            </el-form-item>
            <el-form-item label="其他(万)">
              <span>{{ props.row.mhProjectInfo|getJsonName('fundSourceOthers') }}</span>
            </el-form-item>
            <el-form-item label="项目预计开工时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('startTimePlan') }}</span>
            </el-form-item>
            <el-form-item label="项目预计完工时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('endTimePlan') }}</span>
            </el-form-item>
            <el-form-item label="项目实际开工时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('startTimeActual') }}</span>
            </el-form-item>
            <el-form-item label="项目实际完工时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('endTimeActual') }}</span>
            </el-form-item>
           <!-- <el-form-item label="投资监理">
              <span>{{ props.row.mhProjectInfo|getJsonName('investmentSupervisionName') }}</span>
            </el-form-item>
            <el-form-item label="投资监理时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('investmentSupervisionTime') }}</span>
            </el-form-item>-->
            <el-form-item label="施工监理">
              <span>{{ props.row.mhProjectInfo|getJsonName('constructionSupervisionName') }}</span>
            </el-form-item>
            <el-form-item label="施工监理时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('constructionSupervisionTime') }}</span>
            </el-form-item>
            <el-form-item label="财务监理">
              <span>{{ props.row.mhProjectInfo|getJsonName('finacialSupervisionName') }}</span>
            </el-form-item>
            <el-form-item label="财务监理时间">
              <span>{{ props.row.mhProjectInfo|getJsonName('finacialSupervisionTime') }}</span>
            </el-form-item>
            <el-form-item label="中标轮数">
              <span>{{ props.row.round }}</span>
            </el-form-item>
            <el-form-item label="撤消申请文件"  v-if="!hasPermission(['company:bidder'])" >
              <span>
                <el-image
                  v-if="props.row.fileAddress"
                  style="width: 100px; height: 100px;"
                  :src="JSON.parse(props.row.fileAddress)[0]"
                  fit="scale-down"
                  :preview-src-list="JSON.parse(props.row.fileAddress)">
                </el-image>
              </span>
            </el-form-item>
            <el-form-item label="说明"  v-if="!hasPermission(['company:bidder'])" >
              <span>{{ props.row.remark }}</span>
            </el-form-item>
          </el-form>
        </template>
      </el-table-column>


      <el-table-column
        label="发起方单位"
        prop="bossDeptName"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.bossDeptName }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="发起方联系人"
        prop="mhProjectInfo.projectMainUnitLinkman"
        align="center"
        min-width="100"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfo.projectMainUnitLinkman }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="发起方电话"
        prop="bossDeptName"
        align="center"
        min-width="120"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfo.telephone }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="项目名称"
        prop="mhProjectInfoProjectName"
        align="left"
        min-width="350"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfoName}}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="类型名称"
        prop="categoryName"
        align="left"
        min-width="350"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.categoryName }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="项目建安投资(万)"
        prop="mhProjectInfoTotalInvestment"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfo|getJsonName('totalInvestment') }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="定点供应商名称"
        prop="deptName"
        align="center"
        min-width="350"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.deptName }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="联系人"
        prop="mhLinkman"
        align="center"
        min-width="100"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhLinkman }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="联系电话"
        prop="mhPhone"
        align="center"
        min-width="120"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhPhone }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="邮箱"
        prop="mhEmail"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhEmail }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="项目预计开工时间"
        prop="mhProjectInfoStartTimePlan"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfo|getJsonName('startTimePlan') }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="项目预计完工时间"
        prop="mhProjectInfoEndTimePlan"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.mhProjectInfo|getJsonName('endTimePlan') }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="创建时间"
        prop="createdate"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.createdate }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="状态"
        prop="mhProjectInfoStatus"
        align="center"
        min-width="70"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.status|getJsonName() }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="编号"
        prop="bidRecordNumber"
        align="center"
        min-width="150"
        :fixed="false">
        <template slot-scope="{row}">
          <span>{{ row.bidRecordNumber }}</span>
        </template>
      </el-table-column>


      <!--操作Button + 页面级权限控制:hasPermission -->
      <el-table-column  v-if="!hasPermission(['company:bidder'])" fixed="right" label="操作" align="center" min-width="200">
        <template slot-scope="{row,$index}">
          <el-button-group v-if="hasPermission(['manager:purchase','manager:financial'])">
            <!--管理方 manager:purchase；manager:financial-->
            <el-button v-if="row.status.id===1"   type="primary" icon="el-icon-edit" size="mini" @click="handleAgree(row)">
              通过
            </el-button>
            <el-button  v-if="row.status.id===1"  type="primary" icon="el-icon-edit" size="mini" @click="handleReject(row)">
              驳回
            </el-button>
          </el-button-group>
          <el-button-group v-if="hasPermission(['company:boss'])">
            <el-button v-if="row.status.id===0"  type="primary" icon="el-icon-edit" size="mini" @click="handleWithDraw(row)">
              申请撤回
            </el-button>
          </el-button-group>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
                @pagination="getList"/>

    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
      <form-details ref="formDetails" :row="row" :isModule="true" @createResult="createResult"
                    @updateResult="updateResult"/>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">
          取消
        </el-button>
        <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
          保存
        </el-button>
      </div>
    </el-dialog>

    <el-dialog title="申请撤销" :visible.sync="dialog4WithdrawVisible" width="50%">
      <WithdrawDialog ref="withdrawDialog" :isModule="true" :row="row" @withdrawResult="withdrawResult"/>
      <el-button type="primary" @click="withdraw()">
        申请撤销
      </el-button>
    </el-dialog>

  </div>
</template>

<script>
  import { fetchList, deleteApi,updateApi, treeProjCategory } from './api'
  import waves from '@/directive/waves' // waves directive
  import { parseTime, reorgQueryParams, resizeTableHeight } from '@/utils'
  import checkPermission from '@/utils/permission'
  import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  import FormDetails from './form-details.vue' // add form form dialog
  // 从当前View的私有数据对象中取数据
  import { pickerOptions, pickerOptionsSingleDate } from './data'
  // 导入多选项组件
  import SelectOption from '@/views/coding/components/SelectOption'
  import WithdrawDialog from './withdraw-dialog'

  export default {
    name: 'MhBidRecord-List',

    components: { Pagination, FormDetails, SelectOption, WithdrawDialog },
    directives: { waves },

    props: {
      // 作为子组件时，需要回调传值；应用场景：一对多关联查询时，点击左边查询列表，传值给右边子列表，查询子列表结果
      isModule: {
        type: Boolean,
        default: false
      },
      // 当作为侧边查询结果显示的右子组件时，接收父组件的传值，watch中查询
      parentRow: Object
    },

    filters: {
      statusFilter(status) {
        const statusMap = {
          published: 'success',
          draft: 'info',
          deleted: 'danger'
        }
        return statusMap[status]
      }
    },

    data() {
      return {
        allCategoryData: [],
        mhCategoryId: '',
        //'项目状态    (0, "正常"), (1, "撤销中"),(2, "已撤销")(3, "草稿");
        options: [{
          value: '0',
          label: '正常'
        }, {
          value: '1',
          label: '撤销中'
        }, {
          value: '2',
          label: '已撤销'
        }],
        value: '',
        tableKey: 0,
        btnIdList: [1, 2, 3, 4, 5],
        list: [],
        total: 0,
        footer: [],
        listLoading: false,
        queryLoading: false,
        downloadLoading: false,
        listQuery: {
          page: 1,
          limit: 20
        },
        importanceOptions: [1, 2, 3],
        sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
        statusOptions: ['published', 'draft', 'deleted'],
        dialogFormVisible: false,
        dialog4WithdrawVisible:false,
        dialogStatus: '',
        textMap: {
          update: '编辑',
          create: '新增'
        },
        pickerOptions: pickerOptions,
        pickerOptionsSingleDate: pickerOptionsSingleDate,
        mhProjectInfoIdList: [], // 多选项列表
        mhBidRoundIdList: [], // 多选项列表
        deleteflagList: [], // 多选项列表
        row: {},
        tableHeight: 0, // 表格高度
        filterContainerHeight: 0, // 查询容器高度
        clientHeight: 0 // 浏览器高度
      }
    },
    computed: {
      // button is show
      hasAddBtn() {
        if (this.btnIdList.filter(id => id === 1).length != 0) {
          return true
        }
        return false
      },
      hasEditBtn() {
        if (this.btnIdList.filter(id => id === 2).length != 0) {
          return true
        }
        return false
      },
      hasDelBtn() {
        if (this.btnIdList.filter(id => id === 3).length != 0) {
          return true
        }
        return false
      },
      hasDownloadBtn() {
        if (this.btnIdList.filter(id => id === 4).length != 0) {
          return true
        }
        return false
      }
    },

    watch: {
      // 当作为侧边查询的子组件时，接收父组件的传值，watch中查询
      parentRow(pRow) {
        this.listQuery[pRow.classInstance + 'Id'] = pRow.id // parantId, 需修改成主表ID。******
        this.handleFilter()
      }
    },

    created() {
      this.getList()
    },

    mounted() {
      // 浏览器、元素大小变化时，动态调整table高度
      resizeTableHeight(this, 'filter-container-MhBidRecord')
      this.treeProjCategory(0)
    },

    methods: {
      treeProjCategory(id) {
        treeProjCategory({ id: id }).then(r => {
          this.allCategoryData = r.obj.mhCategoryList
        })
      },
      // handleCategoryIdChange(val) {
      //   if(val.length>0){
      //     let index = val.length - 1
      //     if (index >= 0) {
      //       this.listQuery.mhCategoryId = val[index]
      //     }
      //   }
      //
      // },
      handleCategoryIdChange(val) {
        if (val.length > 0) {
          let datas = ''
          val.forEach(item => {
            let index = item.length - 1
            if (index >= 0) {
              let data = item[index]
              datas = datas + data + ','
            }
          })
          if (datas.length > 0) {
            datas = datas.substr(0, datas.length - 1)
          }
          this.listQuery.mhCategoryIds = datas

        } else {
          this.listQuery.mhCategoryIds = ''
        }

      },
      // 页面级权限控制，调用方法如：hasPermission(['a2user:delete'])
      hasPermission(needPermisions) {
        return checkPermission(needPermisions)
      },
      // 刷新
      getList() {
        this.queryLoading = true
        this.listLoading = true
        // 重组查询条件
        const params = Object.assign({}, this.listQuery)
        reorgQueryParams(params)
        // 查询
        fetchList(params).then(result => {
          if (!result.success) {
            this.notify(result)
            this.queryLoading = false
            this.listLoading = false
            return
          }
          this.list = result.map.rows
          this.total = result.map.total
          // footer
          if (result.map.footer && result.map.footer.length > 0) {
            this.footer = result.map.footer
          }
          this.queryLoading = false
          this.listLoading = false
          ++this.tableKey
        })
      },
      // 从第一页开始查询
      handleFilter() {
        this.listQuery.page = 1
        this.getList()
      },
      // 排序
      sortChange(data) {
        const { prop, order } = data
        if (prop === 'id') {
          this.sortByID(order)
        }
      },
      sortByID(order) {
        if (order === 'ascending') {
          this.listQuery.sort = '+id'
        } else {
          this.listQuery.sort = '-id'
        }
        this.handleFilter()
      },
      // SUM
      getSummaries(param) {
        if (this.footer.length == 0) {
          return []
        }
        const sums = []
        const { columns, data } = param
        columns.forEach((column, index) => {
          if (index === 1) {
            sums[index] = '合计'
            return
          }
          if (this.footer[0][column.property] && typeof this.footer[0][column.property] !== 'object') {
            sums[index] = this.footer[0][column.property]
            return
          }
        })
        return sums
      },
      // download excel
      handleDownload() {
        // 重组查询条件
        const params = Object.assign({}, this.listQuery)
        params.page = 1
        params.limit = 10000000
        reorgQueryParams(params)
        console.log(params)
        // 查询
        this.downloadLoading = true
        fetchList(params).then(result => {
          if (!result.success) {
            this.notify(result)
            this.downloadLoading = false
            return
          }
          import('@/vendor/Export2Excel').then(excel => {
            const tHeader = ['Id', '名称', '创建时间', '创建人']  // excel中显示的列名
            const filterVal = ['id', 'name', 'createdate', 'createman'] // excel中显示哪些列，与tHeader对应
            const list = result.map.rows
            const data = this.formatJson(filterVal, list)
            excel.export_json_to_excel({
              header: tHeader,
              data,
              filename: 'excel',
              autoWidth: true,
              bookType: 'xlsx'
            })
            this.downloadLoading = false
          })
        })
      },
      formatJson(filterVal, jsonData) {
        return jsonData.map(v => filterVal.map(j => {
          if (j === 'timestamp') {
            return parseTime(v[j])
          } else {
            return v[j]
          }
        }))
      },
      // 添加操作 start
      handleCreate() {
        this.dialogStatus = 'create'
        this.dialogFormVisible = true
        // 消除上次出现的验证信息
        this.$nextTick(() => {
          this.$refs['formDetails'].clearValidate()
          this.$refs['formDetails'].resetTemp()
          this.$refs['formDetails'].defaultTemp()
        })
      },
      // 调用子组件操作数据
      createData() {
        this.$refs['formDetails'].createData()
      },
      // 子组件操作成功，回调此方法，关闭弹框、刷新
      createResult() {
        this.dialogFormVisible = false
        this.handleFilter()
      },
      // 编辑操作 start
      handleUpdate(row) {
        this.row = Object.assign({}, row) // copy obj
        this.row.deleteflag = this.row.deleteflag.id // 枚举对象，取id值
        this.dialogStatus = 'update'
        this.dialogFormVisible = true
        // 消除上次出现的验证信息
        this.$nextTick(() => {
          this.$refs['formDetails'].clearValidate()
        })
      },
      handleWithDraw(row) {
        this.row = Object.assign({}, row) // copy obj
        // console.log("row")
        // console.log(row.mhProjectInfo)
        this.dialog4WithdrawVisible = true
      },
      withdrawResult(){
        this.dialog4WithdrawVisible = false
        this.getList()
      },
      withdraw(){
        this.$refs['withdrawDialog'].withdraw()
      },
      // 通过审核操作
      handleAgree(row) {
        this.$confirm('确认通过吗？').then(_ => {
          const param = { id: row.id }
          console.log("row")
          console.log(row)
          //中标状态改为已撤销
          param.status = 2
          param.bossDeptId = row.bossDeptId
          param.mhProjectInfoName = row.mhProjectInfoName
          //类型，供查询通知方 类型：10=施工监理、20=投资监理、30=财务监理
          param.categoryTypeId = row.categoryTypeId
          param.tmptAuthDeptId = row.tmptAuthDeptId
          param.mhEmail = row.mhEmail

          updateApi(param).then((r) => {
            this.notify(r)
            if (r.success) {
              this.getList()
            }
          })
          // end
        })
          .catch(_ => {
          })

      },
      // 驳回操作
      handleReject(row) {
        this.$confirm('确认驳回吗？').then(_ => {
          const param = { id: row.id }
          console.log("row")
          console.log(row)
          //中标状态改为已撤销
          param.status = 0
          param.bossDeptId = row.bossDeptId
          param.mhProjectInfoName = row.mhProjectInfoName
          //类型，供查询通知方 类型：10=施工监理、20=投资监理、30=财务监理
          param.categoryTypeId = row.categoryTypeId
          param.tmptAuthDeptId = row.tmptAuthDeptId
          param.mhEmail = row.mhEmail
          updateApi(param).then((r) => {
            this.notify(r)
            if (r.success) {
              this.getList()
            }
          })
          // end
        })
          .catch(_ => {
          })

      },
      // 调用子组件操作数据
      updateData() {
        this.$refs['formDetails'].updateData()
      },
      // 子组件操作成功，回调此方法，关闭弹框、刷新
      updateResult() {
        this.dialogFormVisible = false
        this.getList()
      },
      // 删除操作
      handleDelete(row) {
        this.$confirm('确认删除吗？')
          .then(_ => {
            // delete api
            deleteApi({ id: '' + row.id }).then((r) => {
              this.notify(r)
              if (r.success) {
                this.getList()
              }
            })
            // end
          })
          .catch(_ => {
          })
      },
      // 行点击事件；应用场景：一对多关联查询时，点击左边查询列表，传值给右边子列表，查询子列表结果 xxxxxx
      handleRowClick(row, column, event) {
        // 从父组件调用此方法，进行回调下
        if (this.isModule) {
          row.classInstance = 'mhBidRecord'
          this.$emit('input', row)
        }
      },
      getSortClass: function(key) {
        const sort = this.listQuery.sort
        return sort === `+{key}` ? 'ascending' : 'descending'
      }
    }
  }
</script>
<style>
  .demo-table-expand {
    font-size: 0;
  }

  .demo-table-expand label {
    width: 100px;
    color: #99a9bf;
  }

  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 40%;
  }
</style>
